package com.taoym.voucher.admin.controller;

import com.taoym.voucher.admin.entity.dto.XcxGetUserWithdrawsDTO;
import com.taoym.voucher.admin.entity.dto.XcxGiroDTO;
import com.taoym.voucher.admin.entity.vo.XcxGetUserWithdrawVO;
import com.taoym.voucher.admin.service.XcxUserWithdrawService;
import com.taoym.voucher.common.response.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @coder taoym
 * @datetime 2021/7/16 23:20
 * @desc 小程序用户提现控制器
 */
@RestController
@RequestMapping("/xcx/withdraw")
@Api(tags = "小程序用户提现控制器")
@Validated
public class XcxUserWithdrawController {

    @Autowired
    private XcxUserWithdrawService xcxUserWithdrawService;

    @ApiOperation("查询用户提现信息")
    @GetMapping("/list")
    public Response<XcxGetUserWithdrawVO> listUserWithdraws(@Valid XcxGetUserWithdrawsDTO data) {
        return Response.success(xcxUserWithdrawService.getUserWithdraws(data));
    }

    @ApiOperation("审核提现")
    @GetMapping("/giro")
    public Response<Boolean> giro(@Valid XcxGiroDTO data) {
        return Response.success(xcxUserWithdrawService.giroResult(data));
    }
}
